public class shellSort {
    public static void myShellSort(int[] array) {
        int gap = array.length;
        while (gap > 1) {
            gap = gap / 2;
            shell(array,gap);
        }
    }
    public static void shell(int[] array,int gap){
        for (int i = gap; i < array.length ; i++) {
            int j = i-gap;
            int tmp = array[i];
            while(j >= 0) {
                if (array[j] >= tmp) {
                    array[j+gap] = array[j];
                    j-=gap;
                }else {
                    break;
                }
            }
            array[j+gap] = tmp;
        }
    }
}
